package com.hackerrank.challenges.permutationgame;

import java.util.ArrayList;
import java.util.BitSet;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Solution {
	private static String[] p = {"Alice", "Bob"};
	private static int winner(List<Integer> perm, BitSet comb, Set<BitSet> pw, int nd, int pp) {
		if(nd == 0)
			return pp;
		int cp = (pp + 1) % p.length;
		if(pw.contains(comb))
			return cp;
		for(int i = 0; i < perm.size(); i++) {
			int e = perm.remove(i), nnd = nd;
			if(i > 0 && e < perm.get(i - 1))
				nnd--;
			if(i < perm.size()) {
				if(e > perm.get(i))
					nnd--;
				if(i > 0 && perm.get(i) < perm.get(i - 1))
					nnd++;
			}
			comb.set(e - 1);
			if(winner(perm, comb, pw, nnd, cp) == cp) {
				comb.clear(e - 1);
				pw.add(comb);
				perm.add(i, e);
				return cp;
			}
			comb.clear(e - 1);
			perm.add(i, e);
		}
		return pp;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		for(int t = 0; t < T; t++) {
			int N = in.nextInt(), nd = 0;
			List<Integer> perm = new ArrayList<Integer>();
			for(int i = 0; i < N; i++)
				perm.add(in.nextInt());
			for(int i = 1; i < N; i++)
				if(perm.get(i) < perm.get(i - 1))
					nd++;
			System.out.println(p[winner(perm, new BitSet(N), new HashSet<BitSet>(), nd, 1)]);
		}
	}
}
